This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
RE: Create Outlook object with LotusScript ~Naomi Minhipitheroni 22.May.03 07:36 PM a Web browser Domino Designer All ReleasesWindows 2000
Thank you both, but this doesn't work for me.
I had tried the set outlook = GetObject("","Outlook.Application") line already and this failed with error cannot create automation object when outlook is running.
The main Outlook window closes when using Outlook.Application.Quit, but the task outlook.exe stays in the task manager and that raises the error.
So i have to find a way to realy kill outlook :-) or to hook on the thread that is residend in the memory.
More suggestions?
This is a piece of code i tried:
Sub Initialize
Dim Outlook As Variant
Dim myNameSpace As Variant
Dim objSession As Variant
Dim objAddressList As Variant
Dim Contact As Variant
Dim objField As Variant
Const CdoPR_EMS_AB_PROXY_ADDRESSES = &H800F101E
On Error Goto Cleanup
Set Outlook = Nothing
Set myNameSpace = Nothing
Set objSession = Nothing
Set objAddressList = Nothing
Set Contact = Nothing
Set objField = Nothing
On Error Resume Next
Set Outlook = GetObject( "","Outlook.Application")
If Err > 0 Then
Msgbox Error
On Error Goto Cleanup
Set Outlook = CreateObject("Outlook.Application")
End If
Set myNameSpace = Outlook.GetNameSpace("MAPI")
Set objSession = Outlook.CreateObject("MAPI.Session")
objSession.Logon "Microsoft Outlook Internet Settings"
Set objAddressList = objSession.AddressLists("Outlook Address Book")
...........
Cleanup:
If Err > 0 Then
Msgbox Err & ": " & Error
End If
' objSession.Logoff
Outlook.Quit
Outlook.Application.Quit
Set Outlook = Nothing
Set myNameSpace = Nothing
Set objSession = Nothing
Set objAddressList = Nothing
Set Contact = Nothing
Set objField = Nothing
Exit Sub
Resume